﻿@model IEnumerable<DFYE.Web.Models.guestBook>
@using DFYE.Web.Models;
@using JULONG.WEB.Library
@{

    student st = ViewBag.student as student;
}
@{
    ViewBag.Title = "留言";
    paging paging = new paging();
    paging.pageSize = 15;
    dynamic pagingMode;
    var vModel = paging.content(
        Model.OrderByDescending(d=>d.datetime),
        out pagingMode, Html.getRoute("page").As<int>()
        );
    ViewBag.paging = pagingMode;
}
<h2>[@st.name]家长留言</h2>

<table>
    <tr>
        <th>时间</th>
        <th>
            
        </th>

        <th>
            ip
        </th>
        <th>
            最近回复时间
        </th>
        <th>
            回复
        </th>
        <th></th>
    </tr>
@foreach (var item in Model) {
    <tr>

        <td>
            @String.Format("{0:g}", item.datetime)
        </td>
        <td title="@item.content">
            
            @item.content.tryHTMLSubstring(0, 50)
        </td>
        <td>
            @item.ip
        </td>
        <td>
            @String.Format("{0:g}", item.replyDatetime)
        </td>
        <td>
            @if (item.able) { 
                <span style="color:red;">新</span>
            }else{
                
            }
        </td>
        <td>
            @Html.ActionLink("回复", "reply", new { id=item.ID }) |
            @Html.ActionLink("编辑", "Edit", new { id=item.ID }) |

            @Html.ActionLink("删除", "Delete", new { id=item.ID })
        </td>
    </tr>
}
</table>
@Html.Partial("paging", new { action = "Index" })

